<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        $('form').on('submit', function (e) {
            e.preventDefault()
            if ($('#username').val() == '') {
                alert('用户名不能为空')
                return;
            }



            // 思考：学习serialize为了方便收集数据
            为了
        })
    </script>
</body>

</html>